package com.design.command.player;

import com.design.command.player.action.Action;

import java.util.ArrayList;
import java.util.List;

public class Controller {

    private List<Action> actions = new ArrayList<>();

    public void addAction(Action action) {
        actions.add(action);
    }

    public void execute(Action action) {
        action.execute();
    }

    public void exectues() {
        for (Action action : actions) {
            action.execute();
        }
        actions.clear();
    }
}
